package com.smart.sso.server.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.smart.mvc.model.Pagination;
import com.smart.mvc.service.mybatis.impl.ServiceImpl;
import com.smart.sso.server.dao.LogDao;
import com.smart.sso.server.model.Log;
import com.smart.sso.server.service.LogService;

/**
 * 负责日志数据库操作
 * @author Administrator
 *
 */
@Service("LogService")
public class LogServiceImpl extends ServiceImpl<LogDao , Log , Integer> implements LogService{
	
	@Autowired
	public void setDao(LogDao dao) {
		this.dao = dao;
	}

	@Override
	public void add(Log log) {
		// TODO Auto-generated method stub
		dao.insert(log);
	}

	@Override
	public Pagination<Log> findPaginationByAccount(String account, Pagination<Log> p) {
		// TODO Auto-generated method stub
		dao.findPaginationByAccount(account, p);
		return p;
	}

	@Override
	public Pagination<Log> findPaginationByDate(String startDate, String endDate ,Pagination<Log> p) {
		// TODO Auto-generated method stub
		dao.findPaginationByDate(startDate, endDate , p);
		return p;
	}

	@Override
	public Pagination<Log> findPaginationByAccountAndDate(Integer userId, String account, String startDate ,String endDate, Pagination<Log> p) {
		// TODO Auto-generated method stub
		dao.findPaginationByAccountAndDate(userId, account, startDate , endDate, p);
		return p;
	}

	@Override
	public Pagination<Log> findAllPagination(Pagination<Log> p) {
		// TODO Auto-generated method stub
		dao.findAllPagination(p);
		return p;
	}
}
